extends Panel

func _unhandled_input(event: InputEvent) -> void:
	if event is InputEventKey and event.keycode == KEY_ESCAPE and event.is_pressed() and not event.is_echo():
		if Game.current_state in [Game.GameState.GAMING]:
			Game.set_state.rpc(Game.GameState.GAMING_MENU)
		elif Game.current_state in [Game.GameState.GAMING_MENU, Game.GameState.GAMING_MENU_SETTING]:
			Game.set_state.rpc(Game.GameState.GAMING)


func _on_setting_button_down() -> void:
	pass # Replace with function body.


func _on_home_button_down() -> void:
	Game.clean_server()
	Game.set_state(Game.GameState.HALL)


func _on_quit_button_down() -> void:
	get_tree().quit()
